#define _CRT_SECURE_NO_WARNINGS 1




//1.
#include <stdio.h>
#include <math.h>
int mypow(int a, int n)
{
    int ret = 1;
    for (int j = 1; j <= n; j++)
    {
        ret *= a;
    }
    return ret;
}
int main()
{

    int count = 0;
    int i = 0;
    int n = 0;
    scanf("%d", &i);
    int j = 0;
    for (j = 0; j <= i; j++)
    {
        int tmp = j;
        while (tmp /= 10)
        {
            n++;

        }
        if ((j * j) % mypow(10, n + 1) == j)
        {
            count++;
        }
    }
    printf("%d", count);
    return 0;
}








//2.
#include <stdio.h>
#include <math.h>

void IsPrimeNumber(int n, int* pcount)
{
    int j = 0;

    for (j = 2; j < n; j++)
    {
        if (n % j == 0)
        {

            return;
        }
    }
    if (n > 1)
        (*pcount)++;
}
int main()
{
    int input;
    scanf("%d", &input);
    int i = 0;
    int count = 0;
    for (i = 1; i < input; i++)
    {
        IsPrimeNumber(i, &count);
    }
    printf("%d", count);
    return 0;
}